<html>

<head>
    <meta charset='utf-8' />
    <title>Deferred Rendering</title>
    <meta name='apple-mobile-web-app-capable' content='yes' />
    <meta name='full-screen' content='true' />
    <meta name='screen-orientation' content='portrait' />
    <meta name='x5-fullscreen' content='true' />
    <meta name='360-fullscreen' content='true' />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <meta name="viewport"
        content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <style>
              :root {
        color-scheme: light dark;
      }
      html, body {
        margin: 0;      /* remove default margin */
        height: 100%;   /* make body fill the browser window */
        display: flex;
        place-content: center center;
      }
    </style>
</head>

<body>
    <div>
        <p id="description" style="width: 600px;">
            This example shows how to do deferred rendering with webgpu.
            Render geometry info to multiple targets in the gBuffers in the first pass.
            In this sample we have 3 gBuffers for positions, normals, and albedo.
            And then do the lighting in a second pass with per fragment data read from gBuffers so it's independent of
            scene complexity.
            We also update light position in a compute shader, where further operations like tile/cluster culling could
            happen.
        </p>
        <canvas id="webgpu" style="width: 600px; height: 600px;"></canvas>
    </div>

    <script type="module" src="./index.ts"></script>
</body>

</html>